package com.alipay.api.internal.parser.json;

import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayParser;
import com.alipay.api.AlipayRequest;
import com.alipay.api.AlipayResponse;
import com.alipay.api.SignItem;
import com.alipay.api.internal.parser.json.JsonConverter;

public class ObjectJsonParser implements AlipayParser {

   private Class clazz;


   public ObjectJsonParser(Class clazz) {
      this.clazz = clazz;
   }

   public AlipayResponse parse(String rsp) throws AlipayApiException {
      JsonConverter converter = new JsonConverter();
      return converter.toResponse(rsp, this.clazz);
   }

   public Class getResponseClass() {
      return this.clazz;
   }

   public SignItem getSignItem(AlipayRequest request, AlipayResponse response) throws AlipayApiException {
      JsonConverter converter = new JsonConverter();
      return converter.getSignItem(request, response);
   }
}
